﻿<%@ Page Language="C#" MasterPageFile="~/Global/User.Master" AutoEventWireup="true"
    CodeBehind="cart.aspx.cs" Inherits="TVC_WEB.Global.cart" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .btnShop
        {
            background-image: url(                   '/Global/images/continue-shopping.gif' );
            width: 170px;
            height: 30px;
            border: none;
            cursor: pointer;
        }
        .btnUpdate
        {
            background-image: url(                   '/Global/images/update-basket.gif' );
            border: none;
            cursor: pointer;
            width: 170px;
            height: 30px;
        }
        .btnCheckout
        {
            background-image: url(                   '/Global/images/checkout.gif' );
            border: none;
            cursor: pointer;
            width: 170px;
            height: 30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div id="breadcrumb">
        <p class="first">
            <asp:Literal ID="lbCatePath" runat="server" Mode="PassThrough"></asp:Literal>
        </p>
    </div>
    <h1>
        <asp:Literal ID="lbCateName" runat="server" Mode="PassThrough" Text="Shopping Basket"></asp:Literal></h1>
    <div id="basket">
        <asp:ListView ID="lvcart" runat="server" 
            onitemdeleting="lvcart_ItemDeleting">
            <LayoutTemplate>
                <table class="basket">
                    <tbody>
                        <tr class="alt">
                            <td align="center" style="padding-right: 0px">
                                &nbsp;
                            </td>
                            <td align="left">
                                <b>Item</b>
                            </td>
                            <td align="center">
                                <b>Qty</b>
                            </td>
                            <td align="right">
                                <b>Price</b>
                            </td>
                            <td align="right">
                                <b>Subtotal</b>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr class="alt">
                            <td colspan="6" style="padding: 0px">
                                <center>
                                    <div class="hrd">
                                        <hr />
                                    </div>
                                </center>
                            </td>
                        </tr>
                        <tr id="itemPlaceHolder" runat="server">
                        </tr>
                        <tr>
                            <td colspan="6" style="padding-left: 0px; padding-right: 0px;">
                                <center>
                                    <div class="hrd">
                                        <hr />
                                    </div>
                                </center>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </LayoutTemplate>
            <EmptyItemTemplate>
                <div style="width: 100%;">
                    Sorry, no products in your basket
                </div>
            </EmptyItemTemplate>
            <ItemTemplate>
                <tr>
                    <td align="center" style="padding-top: 10px; padding-right: 0px;">
                        <asp:HiddenField ID="hdID" runat="server" Value='<%#Eval("ID") %>' />
                        <a href="prodetail.aspx?id=<%#Eval("ID") %>">
                            <img src="<%#GetImage(Eval("Image").ToString()) %>" height="27px" hspace="0" vspace="0"
                                alt="<%#Eval("NameVN") %>" /></a>
                    </td>
                    <td align="left" width="100%" style="padding-top: 10px">
                        <a href="prodetail.aspx?id=<%#Eval("ID") %>">
                            <%#Eval("NameVN") %></a> -
                        <%#Eval("ShortDecribes")%>
                    </td>
                    <td align="center" style="padding-top: 10px">
                        <asp:TextBox ID='txtQty' Width='50px' runat='server' Text='<%#Bind("Qty") %>'></asp:TextBox>
                    </td>
                    <td align="right" style="padding-top: 10px">
                        <%#GetPrice(Eval("NewPrice").ToString())%>
                    </td>
                    <td align="right" style="padding-top: 10px">
                        <%#GetPrice(Eval("SubTotal").ToString())%>
                    </td>
                    <td align="right" style="padding-top: 10px">
                        <asp:ImageButton ID="btnDelelte" runat="server" ImageUrl="/Global/images/customer-reviews.gif"
                            CommandName="Delete" />
                    </td>
                </tr>
            </ItemTemplate>
            <ItemSeparatorTemplate>
                <tr>
                    <td colspan="6" style="padding-left: 0px; padding-right: 0px;">
                        <center>
                            <div class="hrd">
                                <hr />
                            </div>
                        </center>
                    </td>
                </tr>
            </ItemSeparatorTemplate>
        </asp:ListView>
        <table class="basket">
            <tbody>
                <tr>
                    <td align="center" style="padding-right: 0px">
                        &nbsp;
                    </td>
                    <td align="left">
                        <table class="options">
                            <tbody>
                                <tr>
                                    <td>
                                        &nbsp;&nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div style="padding-top: 10px; width: 322px;">
                        </div>
                    </td>
                    <td colspan="2" align="right">
                        <b>Total: </b>
                    </td>
                    <td align="right">
                        <b>
                            <asp:Literal ID="lbTotal" runat="server"></asp:Literal></b>
                    </td>
                    <td align="right">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="padding-left: 0px; padding-right: 0px;">
                        <center>
                            <div class="hrd">
                                <hr />
                            </div>
                        </center>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="p">
            <table class="grid">
                <tbody>
                    <tr>
                        <td width="33%" align="center">
                            <asp:Button ID="btnShop" runat="server" Text="" CssClass="btnShop" OnClick="btnShop_Click" />
                        </td>
                        <td width="33%" align="center">
                            <asp:Button ID="btnUpdate" runat="server" Text="" CssClass="btnUpdate" OnClick="btnUpdate_Click" />
                        </td>
                        <td width="33%" align="center">
                            <asp:Button ID="btnCheckout" runat="server" Text="" CssClass="btnCheckout" OnClick="btnCheckout_Click" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="clear">
        </div>
    </div>
</asp:Content>
